<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>微服务管理系统</title>
		<!-- Tell the browser to be responsive to screen width -->
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
		
		<link rel="stylesheet" href="../../bower_components/select2/dist/css/select2.min.css">
		<!-- Bootstrap 3.3.7 -->
		<link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.min.css">
		<!-- Font Awesome -->
		<link rel="stylesheet" href="../../bower_components/font-awesome/css/font-awesome.min.css">
		<!-- Ionicons -->
		<link rel="stylesheet" href="../../bower_components/Ionicons/css/ionicons.min.css">
		<!-- DataTables -->
		<link rel="stylesheet" href="../../bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
		<!-- Theme style -->
		<link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">
		<!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
		<link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">
		<!-- Select2 -->
    

		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

		<!-- Google Font -->
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
		<style>
			body,
			td {
				font-size: 15px !important;
				/*font-weight:600*/
			}
			
			;
		</style>
	</head>

	<body class="hold-transition skin-blue sidebar-mini">
		<div class="wrapper">

			<header class="main-header">
				<!-- Logo -->
				<a href="#" class="logo">
					<!-- mini logo for sidebar mini 50x50 pixels -->
					<span class="logo-mini"><b>微</b>服务</span>
					<!-- logo for regular state and mobile devices -->
					<span class="logo-lg"><b>微服务</b>管理系统</span>
				</a>
				<!-- Header Navbar: style can be found in header.less -->
				<nav class="navbar navbar-static-top">
					<!-- Sidebar toggle button-->
					<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>

					<div class="navbar-custom-menu">
						<ul class="nav navbar-nav">
							<!-- User Account: style can be found in dropdown.less -->
							<li class="dropdown user user-menu">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">
									<img src="../../dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
									<span class="hidden-xs">admin</span>
								</a>
							</li>
							<!-- Control Sidebar Toggle Button -->
						</ul>
					</div>
				</nav>
			</header>
			<!-- Left side column. contains the logo and sidebar -->
			<aside class="main-sidebar">
				<!-- sidebar: style can be found in sidebar.less -->
				<section class="sidebar">
					<!-- Sidebar user panel -->
					<div class="user-panel">
						<div class="pull-left image">
							<img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
						</div>
						<div class="pull-left info">
							<p>admin</p>
							<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
						</div>
					</div>
					<!-- sidebar menu: : style can be found in sidebar.less -->
					<ul class="sidebar-menu" data-widget="tree">
						<li class="treeview active">
							<a href="#">
								<i class="fa fa-table"></i> <span>列表</span>
								<span class="pull-right-container">
				                  <i class="fa fa-angle-left pull-right"></i>
				                </span>
							</a>
							<ul class="treeview-menu">
								<li>
									<a href="list_page.html"><i class="fa fa-circle-o"></i>内部服务列表页</a>
								</li>
								<li>
									<a href="outside_list_page.html"><i class="fa fa-circle-o"></i>外部服务列表页</a>
								</li>
								<li>
									<a href="dock_party_page.html"><i class="fa fa-circle-o"></i>接入方列表</a>
								</li>
								<li>
									<a href="user_authority.html"><i class="fa fa-circle-o"></i>用户权限管理</a>
								</li>
							</ul>
						</li>
						<li class="treeview active">
							<a href="#">
								<i class="fa fa-edit"></i> <span>表单</span>
								<span class="pull-right-container">
				                  <i class="fa fa-angle-left pull-right"></i>
				                </span>
							</a>
							<ul class="treeview-menu">
								<li>
									<a href="test_service.html"><i class="fa fa-tumblr"></i>内部服务测试</a>
								</li>
							</ul>
						</li>
					</ul>
				</section>
				<!-- /.sidebar -->
			</aside>

			<!-- Content Wrapper. Contains page content -->
			<div class="content-wrapper">
				<!-- Content Header (Page header) -->
				<section class="content-header">
					<h1>微服务管理系统</h1>
					<ol class="breadcrumb">
						<li><i class="fa fa-dashboard"></i> 主页</ a>
						</li>
						<li>用户权限管理</li>
						<li class="active">用户权限列表</li>
					</ol>
				</section>

				<!-- Main content -->
				<section class="content">
					<div class="row">
						<div class="col-xs-12">
							<div class="box">
								<div class="box-header">
									<div class="col-sm-6">
										<h3 class="box-title">用户权限列表</h3>
									</div>
			                        <div class="col-sm-4">
			                                <label for="apiNameForSearch" style="padding-top: 6px;float: left;margin-right: 5px;">接入方标识名&nbsp;</label>
			                                <div class="input-group input-group-sm" style="width: 220px;">
			                                    <input type="text"  class="form-control pull-right" name="tagNameForSearch" id="tagNameForSearch" onkeypress="return huichesearchTag()">
			                                    <div class="input-group-btn">
			                                        <button type="button" class="btn btn-default" id="tagNameSearch"  style="float: left;" onclick="searchInfoTag();"><i class="fa fa-search"></i></button>
			                                    </div>
			                                </div>
			                        </div>
									<button type="button" class="btn btn-danger" style="float: right; margin-right: 2%;" onclick="delUserAuthority();">
                      					<i class="fa fa-fw fa-times-circle"></i>删除
                  					</button>
									<button type="button" class="btn btn-default" style="float: right; margin-right: 2%;" onclick="addUserAuth();">
							             <i class="fa fa-fw fa-plus-circle"></i>新增
							         </button>
								</div>
								<!-- /.box-header -->
								<div class="box-body">
									<table id="userAuthTab" class="table table-bordered table-striped" width="100%">
										<thead>
											<tr>
												<th style="text-align: center;">
												</th>
												<th style="text-align: center;">序号</th>
												<th style="text-align: center;">服务名</th>
												<th style="text-align: center;">接入方标识名</th>
												<th style="text-align: center;">主机名</th>
												<th style="text-align: center;">备注</th>
												<th style="text-align: center;">允许使用的模式</th>
												<th style="text-align: center;">作者</th>
												<th style="text-align: center;">创建时间</th>
												<th style="text-align: center;">状态</th>
												<th style="text-align: center;">操作</th>
											</tr>
										</thead>
										<tbody></tbody>
									</table>
								</div>
								<!-- /.box-body -->
							</div>
							<!-- /.box -->
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</section>
				<!-- /.content -->
			</div>
		</div>
		<!-- ./wrapper -->
		<!-- 新增模态框（Modal） -->
		<div class="modal fade" id="userAuthModal" tabindex="-1" role="dialog" aria-labelledby="addAcctSubjectModalLabel" aria-hidden="true">
			<!--<div class="modal-dialog modal-lg">-->
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<div class="row">
								<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-right: 10px;">
									&times;
								</button>
							<h3 class="modal-title" style="text-align: center;margin-left: 22px;">编辑用户权限</h3>
						</div>
					</div>
					<div class="modal-body">
						<input type="hidden" class="form-control" name="flag" id="flag">
						<form id="addUserAuthFrm" class="form-horizontal">
							<div class="box-body">
								<label for="apiName" class="col-sm-3 control-label">服务名称</label>
								<div class="form-group">
									<div class="col-sm-7">
										<input type="text" class="form-control" name="apiName" id="apiName" minlength="5">
									</div>
								</div>
								<label for="tagName" class="col-sm-3 control-label">接入方标识名</label>
								<div class="form-group">
									<div class="col-sm-7">
										<input type="text" class="form-control" name="tagName" id="tagName">
									</div>
								</div>
								<label for="author" class="col-sm-3 control-label">作者</label>
								<div class="form-group">
									<div class="col-sm-7">
										<input type="text" class="form-control" name="author" id="author">
									</div>
								</div>
								<label for="remark" class="col-sm-3 control-label">备注</label>
								<div class="form-group">
									<div class="col-sm-7">
										<input type="text" class="form-control" name="remark" id="remark">
									</div>
								</div>
								<!--<label for="model" class="col-sm-3 control-label">允许使用的模式</label>
								<div class="form-group">
									<div class="col-sm-7">
										<input type="text" class="form-control" name="model" id="model">
									</div>
								</div>-->
								<label class="col-sm-3 control-label">允许使用的模式</label>
                                    <div class="form-group">
                                        <div class="col-sm-7" id="removess">
                                            <select class="form-control select2" multiple="multiple" name="model" id ="model" style="width: 100%;">
                                            	<option value="prod">生产模式</option>
                                            	<option value="test">测试模式</option>
                                            	<option value="debug">调试模式</option>
                                            </select>
                                        </div>
                                    </div>
								<label for="outside" class="col-sm-3 control-label">状态</label>
								<div class="form-group">
									<div class="col-sm-7">
										<input id="outsideY" type="radio" value="1" name="status" checked="checked"><label for="outsideY">开启</label> </input>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<input id="outsideN" type="radio" value="0" name="status"><label for="outsideN">关闭</label> </input>
									</div>
								</div>
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" onclick="saveUserAuth();">保存</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
			<!-- /.modal dialog-->
		</div>
		<!-- /.Modal -->
		<!-- jQuery 3 -->
		<script src="../../bower_components/jquery/dist/jquery.min.js"></script>
		<script src="../../bower_components/select2/dist/js/select2.js"></script>
		<!-- Bootstrap 3.3.7 -->
		<script src="../../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
		<!-- DataTables -->
		<script src="../../bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
		<script src="../../bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
		<!-- SlimScroll -->
		<script src="../../bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
		<!-- FastClick -->
		<script src="../../bower_components/fastclick/lib/fastclick.js"></script>
		<!-- AdminLTE App -->
		<script src="../../dist/js/adminlte.min.js"></script>
		<!-- AdminLTE for demo purposes -->
		<script src="../../dist/js/demo.js"></script>
		<script src="common.js"></script>
		<!-- page script -->
		<script>
			$(document).ready(function () {
		        $('.select2').select2({
		            // tags : true,
		            multiple : true,
		            allowClear : true,
		            language: "zh-CN",
		            closeOnSelect: false,
		        });
		    });
			var DataTablePaging = {
				language: { // 汉化
					zh_cn: {
						"sProcessing": "正在加载数据...",
						// "sLoadingRecords": "载入中...",
						"sLengthMenu": "显示&nbsp;_MENU_&nbsp;条 ",
						"sZeroRecords": "没有您要搜索的内容",
						"sInfo": "从_START_ 到 _END_ 条&nbsp;&nbsp;&nbsp;&nbsp;共 _TOTAL_ 条",
						"sInfoEmpty": "记录数为0",
						"sInfoFiltered": "(全部记录数 _MAX_  条)",
						"sInfoPostFix": "",
						"sSearch": "搜索",
						"sUrl": "",
						"oPaginate": {
							"sFirst": "第一页",
							"sPrevious": " 上一页 ",
							"sNext": " 下一页 ",
							"sLast": " 最后一页 "
						}
					}
				}
			};
			$(function() {
				$('#userAuthTab').DataTable({
					"oLanguage": DataTablePaging.language.zh_cn,
					'paging': true,
					'lengthChange': false,
					'searching': false,
					'info': true,
					'width': '100%',
					//'autoWidth': true,
					"scrollY": "calc(80vh - 110px)", //表格内容部分高度设置为窗口高度-100px
					"scrollCollapse": true,
					"scrollX": false, //横向滚动条
					//"ordering": false,
					/*****/
					"fixedHeader": true,
					"responsive": true,
					//"iDisplayLength": 100,// 每页显示行数
					"columnDefs":[{
					　　　　'targets' : [0,1,4,5,6,7,9,10],    //除第2外，都默认不排序
					　　　　'orderable' : false
					　　}],
					'ajax': {
						"url": apiUrl,
						"type": "POST",
						"contentType": "application/json;charset=utf-8",
						"dataType": "json",
						"data": function(d) {
							d.Head = {
								"ApiName": "getUserAuthorityList",
								"Model": "debug"
							};
							d.Body = {
								"tagName":$("#tagNameForSearch").val()
							};
							return JSON.stringify(d)
						},
						"dataSrc":"Body",
					},
					"columns": [{
							"data": "apiName",
							'width': "3%",
							'class': 'text-center',
							"render": function(data, type, full) {
								//var i = '<div class="radio"><label><input type="radio" name="serviceName" value="' + data + '" data-status = "' + full.status + '" data-remark = "' + full.remark + '" data-name = "' + full.name + '"></label></div>';
								var i = '<div class="radio"><label><input type="radio" name="apiName" value="' + data +'" data-tag = "'+full.tagName+'" data-api = "'+full.apiName+'"></label></div>';
								return i;
							}
						},
						{
							"data": "",
							'width': "5%",
							'class': 'text-center',
							"render": function(data, type, full, meta) {
								return meta.settings._iDisplayStart + meta.row + 1;
							}
						},
						{
							"data": "apiName",
							'width': "10%",
							'class': 'text-center',
						},
						{
							"data": "tagName",
							'width': "10%",
							'class': 'text-center',
						},
						{
							"data": "hostName",
							'width': "10%",
							'class': 'text-center',
						},
						{
							"data": "remark",
							'width': "10%",
							'class': 'text-center',
						},
						{
							"data": "model",
							'width': "10%",
							'class': 'text-center',
						},
						{
							"data": "author",
							'width': "10%",
							'class': 'text-center',
						},
						{
							"data": "createTime",
							'class': 'text-center',
							'width': "14%",
						},
						{
							"data": "status",
							'width': "7%",
							'class': 'text-center',
							"render": function(data, type, row) {
								switch(data) {
									case "1":
										return "启用";
										break;
									case "0":
										return "停用";
										break;
								}

							}
						},
						{
							"data": "",
							'width': "12.5%",
							'class': 'text-center',
							"mRender": function(data, type, full) {
								if(full.status == "0"){
									// 停用
									return "<a href=\"javascript:void(0);\" style=\"cursor: pointer;color:#333\" class=\"label label-success\" onclick=\"editStatus('" + full.apiName + "','"+full.tagName+"');\">启用</a>&nbsp;&nbsp;" +
										"<a href=\"javascript:void(0);\" style=\"cursor: pointer;color:#333\" class=\"label label-primary\" onclick=\"addUserAuth('" + full.apiName + "','"+full.tagName+"');\">配置</a>";
								}
								if(full.status =="1"){
									// 启用
									return "<a href=\"javascript:void(0);\" style=\"cursor: pointer;color:#333\" class=\"label label-danger\" onclick=\"editStatus('" + full.apiName + "','"+full.tagName+"');\">停用</a>&nbsp;&nbsp;" +
										"<a href=\"javascript:void(0);\" style=\"cursor: pointer;color:#333\" class=\"label label-primary\" onclick=\"addUserAuth('" + full.apiName + "','"+full.tagName+"');\">配置</a>";
								}
							}
						}
					],
					/*******/
				})
			});

			function addUserAuth(name,tagName) {
				if(name != null && name != undefined && name != ''){
					// 配置操作-请求后台数据并打开配置模态框
					// 设置弹框标识
					$("#flag").val("true");
					$("#apiName").attr("readonly","readonly");
					$("#tagName").attr("readonly","readonly");
					//alert(name)
					 $.ajax({
				        "url": apiUrl,
						"type": "POST",
						"contentType": "application/json;charset=utf-8",
				        "async" : true,
				        "data": JSON.stringify(
							{
							    "Head": {
							        "ApiName": "getUserAuthority",
							        "Model":"debug"
							    },
							    "Body":{
							     "apiName":name,
							     "tagName":tagName
							    }
							}),
				        // 成功后开启模态框
				        success : showModal,
				        error : function() {
				            alert("系统繁忙，请稍后重试");
				        },
				        dataType : "json"
				    });
				}else{
					// 新增操作-打开模态框
					$("#flag").val("");
					$("#apiName").attr("readonly",false);
					$("#tagName").attr("readonly",false);
					$("#userAuthModal").modal({
						backdrop: false, // 点击空白不关闭
						keyboard: false, // 按键盘esc不关闭
					});
				}
				
			};
			// 关闭模态框
			$("#userAuthModal").on("hidden.bs.modal", function() {
				$(this).removeData("bs.modal");
				document.getElementById("addUserAuthFrm").reset();
				$("#model").html("");
                $("#model").append('<option value="prod">生产模式</option>');
                $("#model").append('<option value="test">测试模式</option>');
                $("#model").append('<option value="debug">调试模式</option>');                           	
                                            	
			});
			
			// 查询成功后向模态框插入数据并开启模态框。data是返回的JSON对象
			function showModal(data){
				$("#apiName").val(data.Body.apiName);
			    $("#tagName").val(data.Body.tagName);
			    $("#remark").val(data.Body.remark);
			    $("#author").val(data.Body.author);
			    $("#hostName").val(data.Body.hostName);
			    $("input[name=status][value="+data.Body.status+"]").attr("checked",true);
			    var models = data.Body.model; //“prod,test”
			    var res = getSelect2Data(models);
			    $("#model").select2().val(res).trigger('change');
    			// 打开模态框
				$("#userAuthModal").modal({
					backdrop: false, // 点击空白不关闭
					keyboard: false, // 按键盘esc不关闭
				});
			};
			
			function getSelect2Data(d){
				// 将“prod,test” 分隔成 ‘prod’,'test'
				var des = d.split(",");
				return des;
			};
			
			// 启用停用服务
			function editStatus(name,tagName){
				$.ajax({
				        "url": apiUrl,
						"type": "POST",
						"contentType": "application/json;charset=utf-8",
				        "async" : true,
				        "data": JSON.stringify(
							{
							    "Head": {
							        "ApiName": "changeUserAuthority",
							        "Model":"debug"
							    },
							    "Body":{apiName:name,tagName:tagName}
							}),
				        // 成功后开启模态框
				        success : function(d){
				        	var status = d.Head.Status;
				        	if(status != null && status != undefined && status != '' && status == '0'){
				        		// 操作成功-刷新页面
				        		window.location.reload();
				        	}else{
				        		// 添加失败，弹框提示
				        		alert(d.Head.Exception[0].desc)
				        	}
				        },
				        error : function() {
				            alert("系统繁忙，请稍后重试");
				        },
				        dataType : "json"
				    });
			};
			
			// 保存 & 修改 服务信息
			function saveUserAuth(){
				flag = $("#flag").val();
				if(flag != null && flag != undefined && flag != '' && flag == 'true'){
					// 配置操作提交
					var jsonData = getFormData();
					$.ajax({
				        "url": apiUrl,
						"type": "POST",
						"contentType": "application/json;charset=utf-8",
				        "async" : true,
				        "data": JSON.stringify(
							{
							    "Head": {
							        "ApiName": "updateUserAuthority",
							        "Model":"debug"
							    },
							    "Body":jsonData
							}),
				        // 成功后开启模态框
				        success : function(d){
				        	var status = d.Head.Status;
				        	if(status != null && status != undefined && status != '' && status == '0'){
				        		// 添加成功-关闭模态框&刷新页面
				        		$("#userAuthModal").on("hidden.bs.modal", function() {
								$(this).removeData("bs.modal");
								document.getElementById("addUserAuthFrm").reset();
								});
				        		window.location.reload();
				        	}else{
				        		// 添加失败，弹框提示
				        		alert(d.Head.Exception[0].desc)
				        	}
				        },
				        error : function() {
				            alert("系统繁忙，请稍后重试");
				        },
				        dataType : "json"
				    });
				}else{
					// 新增操作提交
					var jsonData = getFormData();
					$.ajax({
				        "url": apiUrl,
						"type": "POST",
						"contentType": "application/json;charset=utf-8",
				        "async" : true,
				        "data": JSON.stringify(
							{
							    "Head": {
							        "ApiName": "newUserAuthority",
							        "Model":"debug"
							    },
							    "Body":jsonData
							}),
				        // 成功后开启模态框
				        success : function(d){
				        	var status = d.Head.Status;
				        	if(status != null && status != undefined && status != '' && status == '0'){
				        		// 添加成功-关闭模态框&刷新页面
				        		$("#userAuthModal").on("hidden.bs.modal", function() {
								$(this).removeData("bs.modal");
								document.getElementById("addUserAuthFrm").reset();
								});
				        		window.location.reload();
				        	}else{
				        		// 添加失败，弹框提示
				        		alert(d.Head.Exception[0].desc)
				        	}
				        },
				        error : function() {
				            alert("系统繁忙，请稍后重试");
				        },
				        dataType : "json"
				    });
					
				}
			};
			
			//取容器内所有 input 组装成 json
			function getFormData(sel){
				json = {};
				$("#addUserAuthFrm input,#addUserAuthFrm textarea").each(function(){
					json[$(this).attr("name")] = $(this).val();
				});
				json["status"] = $("input[name='status']:checked").val();
				var e = $("#model").select2('data');
				json["model"] = getSelectData(e);
				return json;
			};
			
			function getSelectData(e) {
		        var employees = "";
		        for (var i = 0; i < e.length; i++) {
		            if (i != e.length - 1) {
		                employees += e[i].id + ",";
		            }else {
		                employees += e[i].id;
		            }
		        }
		        return employees;
		    };
			
			// 删除服务
			function delUserAuthority(){
				// 获取选中的服务名称
				var apiName = $('input:radio[name="apiName"]:checked').val();
				var tagName = $('input:radio[name="apiName"]:checked').data("tag");
		        if(apiName == null || apiName == '' || apiName == undefined ){
		            alert("请选择一条数据");
		        }else{
		        	// 删除
		            if(window.confirm('你确定要删除服务吗？')){
	                 	$.ajax({
				        "url": apiUrl,
						"type": "POST",
						"contentType": "application/json;charset=utf-8",
				        "async" : true,
				        "data": JSON.stringify(
							{
							    "Head": {
							        "ApiName": "delUserAuthority",
							        "Model":"debug"
							    },
							    "Body":{apiName:apiName,tagName:tagName}
							}),
					        // 成功后开启模态框
					        success : function(d){
					        	var status = d.Head.Status;
					        	if(status != null && status != undefined && status != '' && status == '0'){
					        		// 删除成功-刷新页面
					        		window.location.reload();
					        	}else{
					        		// 删除失败，弹框提示
					        		alert(d.Head.Exception[0].desc)
					        	}
					        },
					        error : function() {
					            alert("系统繁忙，请稍后重试");
					        },
					        dataType : "json"
					    });
		              }else{
		                 return false;
		             }
		        }
				
			};
			
			// 选中一行即为选中
			$('#userAuthTab tbody').on('click', 'tr', function () {
		        $(this).find("td").find("input:radio").prop('checked', 'checked');
		    });
		    
		    function searchInfoTag() {
		        $("#userAuthTab").DataTable().ajax.reload();
		    };
		    
		    function huichesearchTag(){//回车搜索
		        var keyCode =event.keyCode;
		        if(keyCode== 13){
		            searchInfoTag();
		            return false;
		        }
		    };
		</script>
	</body>

</html>